home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Devpac 2.12 disk 2.adf / include.cbm / libraries / configregs.i next >
Text File  |  1987-03-31  |  7KB  |  206 lines

  1.  
  2. **** configregs.i *********************************************************
  3. *
  4. *  register and bit definitions for expansion boards
  5. *
  6. * Copyright (C) 1985,  Commodore-Amiga, Inc., All rights reserved.
  7. *
  8. * $Header: configregs.i,v 33.2 86/05/04 23:40:52 neil Exp $
  9. *
  10. * $Locker:  $
  11. *
  12. * $Log: configregs.i,v $
  13. * Revision 33.2  86/05/04  23:40:52  neil
  14. * added diag area
  15. * Revision 33.1  86/04/01  12:17:22  neil
  16. * First version
  17. *
  18. ****************************************************************************
  19.  
  20.         IFND    LIBRARIES_CONFIGREGS_I
  21. LIBRARIES_CONFIGREGS_I  SET     1
  22.  
  23. ** Expansion boards are actually organized such that only one nibble per
  24. ** word (16 bits) are valid information.  This table is structured
  25. ** as LOGICAL information.  This means that it never corresponds
  26. ** exactly with a physical implementation.
  27. **
  28. ** The expansion space is logically split into two regions:
  29. ** a rom portion and a control portion.  The rom portion is
  30. ** actually stored in one's complement form (except for the
  31. ** er_type field).
  32.  
  33.  
  34.  STRUCTURE ExpansionRom,0
  35.     UBYTE       er_Type
  36.     UBYTE       er_Product
  37.     UBYTE       er_Flags
  38.     UBYTE       er_Reserved03
  39.     UWORD       er_Manufacturer
  40.     ULONG       er_SerialNumber
  41.     UWORD       er_InitDiagVec
  42.     UBYTE       er_Reserved0c
  43.     UBYTE       er_Reserved0d
  44.     UBYTE       er_Reserved0e
  45.     UBYTE       er_Reserved0f
  46.     LABEL       ExpansionRom_SIZEOF
  47.  
  48.  STRUCTURE ExpansionControl,0
  49.     UBYTE       ec_Interrupt            ; interrupt control register
  50.     UBYTE       ec_Reserved11
  51.     UBYTE       ec_BaseAddress          ; set new config address
  52.     UBYTE       ec_Shutup               ; don't respond, pass config out
  53.     UBYTE       ec_Reserved14
  54.     UBYTE       ec_Reserved15
  55.     UBYTE       ec_Reserved16
  56.     UBYTE       ec_Reserved17
  57.     UBYTE       ec_Reserved18
  58.     UBYTE       ec_Reserved19
  59.     UBYTE       ec_Reserved1a
  60.     UBYTE       ec_Reserved1b
  61.     UBYTE       ec_Reserved1c
  62.     UBYTE       ec_Reserved1d
  63.     UBYTE       ec_Reserved1e
  64.     UBYTE       ec_Reserved1f
  65.     LABEL       ExpansionControl_SIZEOF
  66.  
  67. **
  68. ** many of the constants below consist of a triplet of equivalent
  69. ** definitions: xxMASK is a bit mask of those bits that matter.
  70. ** xxBIT is the starting bit number of the field.  xxSIZE is the
  71. ** number of bits that make up the definition.  This method is
  72. ** used when the field is larger than one bit.
  73. **
  74. ** If the field is only one bit wide then the xxB_xx and xxF_xx convention
  75. ** is used (xxB_xx is the bit number, and xxF_xx is mask of the bit).
  76. **
  77.  
  78. ** manifest constants */
  79. E_SLOTSIZE              EQU     $10000
  80. E_SLOTMASK              EQU     $ffff
  81. E_SLOTSHIFT             EQU     16
  82.  
  83. ** these define the two free regions of Zorro memory space.
  84. ** THESE MAY WELL CHANGE FOR FUTURE PRODUCTS!
  85. E_EXPANSIONBASE         EQU     $e80000
  86. E_EXPANSIONSIZE         EQU     $080000
  87. E_EXPANSIONSLOTS        EQU     8
  88.  
  89. E_MEMORYBASE            EQU     $200000
  90. E_MEMORYSIZE            EQU     $800000
  91. E_MEMORYSLOTS           EQU     128
  92.  
  93.  
  94.  
  95. ******* ec_Type definitions */
  96.  
  97. ** board type -- ignore "old style" boards */
  98. ERT_TYPEMASK            EQU     $c0
  99. ERT_TYPEBIT             EQU     6
  100. ERT_TYPESIZE            EQU     2
  101. ERT_NEWBOARD            EQU     $c0
  102.  
  103.  
  104. ** type field memory size */
  105. ERT_MEMMASK             EQU     $07
  106. ERT_MEMBIT              EQU     0
  107. ERT_MEMSIZE             EQU     3
  108.  
  109.  
  110. ** other bits defined in type field */
  111.         BITDEF  ERT,CHAINEDCONFIG,3
  112.         BITDEF  ERT,DIAGVALID,4
  113.         BITDEF  ERT,MEMLIST,5
  114.  
  115.  
  116. ** er_Flags byte -- for those things that didn't fit into the type byte */
  117.         BITDEF  ERF,MEMSPACE,7          ; wants to be in 8 meg space.  Also
  118.                                         ;     implies that board is moveable
  119.         BITDEF  ERF,NOSHUTUP,6          ; board can't be shut up.  Must not
  120.                                         ;     be a board.  Must be a box that
  121.                                         ;     does not pass on the bus.
  122.  
  123.  
  124. ** interrupt control register */
  125.         BITDEF  ECI,INTENA,1
  126.         BITDEF  ECI,RESET,3
  127.         BITDEF  ECI,INT2PEND,4
  128.         BITDEF  ECI,INT6PEND,5
  129.         BITDEF  ECI,INT7PEND,6
  130.         BITDEF  ECI,INTERRUPTING,7
  131.  
  132.  
  133. **************************************************************************
  134. **
  135. ** these are the specifications for the diagnostic area.  If the Diagnostic
  136. ** Address Valid bit is set in the Board Type byte (the first byte in
  137. ** expansion space) then the Diag Init vector contains a valid offset.
  138. **
  139. ** The Diag Init vector is actually a word offset from the base of the
  140. ** board.  The resulting address points to the base of the DiagArea
  141. ** structure.  The structure may be physically implemented either four,
  142. ** eight, or sixteen bits wide.  The code will be copied out into
  143. ** ram first before being called.
  144. **
  145. ** The da_Size field, and both code offsets (da_DiagPoint and da_BootPoint)
  146. ** are offsets from the diag area AFTER it has been copied into ram, and
  147. ** "de-nibbleized" (if needed).  Inotherwords, the size is the size of
  148. ** the actual information, not how much address space is required to
  149. ** store it.
  150. **
  151. ** All bits are encoded with uninverted logic (e.g. 5 volts on the bus
  152. ** is a logic one).
  153. **
  154. ** If your board is to make use of the boot facility then it must leave
  155. ** its config area available even after it has been configured.  Your
  156. ** boot vector will be called AFTER your board's final address has been
  157. ** set.
  158. **
  159. **************************************************************************
  160.  
  161.  STRUCTURE DiagArea,0
  162.     UBYTE       da_Config       ; see below for definitions
  163.     UBYTE       da_Flags        ; see below for definitions
  164.     UWORD       da_Size         ; the size (in bytes) of the total diag area
  165.     UWORD       da_DiagPoint    ; where to start for diagnostics, or zero
  166.     UWORD       da_BootPoint    ; where to start for booting
  167.     UWORD       da_Name         ; offset in diag area where a string
  168.                                 ;   identifier can be found (or zero if no
  169.                                 ;   identifier is present).
  170.  
  171.     UWORD       da_Reserved01   ; two words of reserved data.  must be zero.
  172.     UWORD       da_Reserved02
  173.     LABEL       DiagArea_SIZEOF
  174.  
  175. ; da_Config definitions
  176. DAC_BUSWIDTH    EQU     $C0     ; two bits for bus width
  177. DAC_NIBBLEWIDE  EQU     $00
  178. DAC_BYTEWIDE    EQU     $40
  179. DAC_WORDWIDE    EQU     $80
  180.  
  181. DAC_BOOTTIME    EQU     $30     ; two bits for when to boot
  182. DAC_NEVER       EQU     $00     ; obvious
  183. DAC_CONFIGTIME  EQU     $10     ; call da_BootPoint when first configing the
  184.                                 ;   the device
  185. DAC_BINDTIME    EQU     $20     ; run when binding drivers to boards
  186.  
  187. **
  188. ** These are the calling conventions for Diag or Boot area
  189. **
  190. ** A7 -- points to at least 2K of stack
  191. ** A6 -- ExecBase
  192. ** A5 -- ExpansionBase
  193. ** A3 -- your board's ConfigDev structure
  194. ** A2 -- Base of diag/init area that was copied
  195. ** A0 -- Base of your board
  196. **
  197. ** Your board should return a value in D0.  If this value is NULL, then
  198. ** the diag/init area that was copied in will be returned to the free
  199. ** memory pool.
  200. **
  201.  
  202.  
  203.         ENDC    !LIBRARIES_CONFIGREGS_I
  204.